package com.atguigu.spring5.service;

import com.atguigu.spring5.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author durant
 * @create 2021-10-30 15:37
 */
@Service
public class UserService {
//    @Autowired
//    @Qualifier(value = "userDaoImpl2")
    @Resource(name = "userDaoImpl2")
    private UserDao userDao;
    @Value("durant")
    private String name;
    public void add(){
        System.out.println("service add ....");
        userDao.add();
        System.out.println(name);
    }
}
